﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Windows.Input;

namespace myWindowsMediaPlayer.ViewModel
{
    class playerViewModel : viewModelBase
    {
        private MediaElement    mElement;

        private ICommand clickPlay;
        private ICommand clickStop;
        private ICommand clickBefore;
        private ICommand clickAfter;

        public playerViewModel(MediaElement mElement)
        {
            this.mElement = mElement;
        }

      

        public ICommand ClickPlay
        {
            get
            {
                if (this.clickPlay == null)
                    clickPlay = new relayCommand(() => this.ManageClickPlay());
                return clickPlay;
            }
        }

        public ICommand ClickStop
        {
            get
            {
                if (this.clickStop == null)
                    clickStop = new relayCommand(() => this.ManageClickStop());
                return clickStop;
            }
        }

        public ICommand ClickBefore
        {
            get
            {
                if (this.clickBefore == null)
                    clickBefore = new relayCommand(() => this.ManageClickBefore());
                return clickBefore;
            }
        }

        public ICommand ClickAfter
        {
            get
            {
                if (this.clickAfter == null)
                    clickAfter = new relayCommand(() => this.ManageClickAfter());
                return clickAfter;
            }
        }

        private void ManageClickPlay()
        {
            mElement.Play();
        }

        private void ManageClickStop()
        {
            mElement.Stop();
        }

        private void ManageClickBefore()
        {
        }

        private void ManageClickAfter()
        {
        }
    }
}
